﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

using DAMNETLibrary.Controllers;
using DAMNETLibrary.Models;

namespace DAMNETWebApplication
{
    public class CommonPageLoggedIn : CommonPage
    {
        /// <summary>
        /// 
        /// </summary>
        /// <param name="e"></param>
        protected override void OnPreLoad(EventArgs e)
        {
            User = UserController.ValidateSession();
            if (User == null)
                Response.Redirect("~/Default.aspx");
            
            base.OnPreLoad(e);
        }

        /// <summary>
        /// 
        /// </summary>
        public User User
        {
            get;
            private set;
        }
    }
}